const express = require('express');
const cors = require('cors');
const app = express();
const port = 3000;
const corsOptions = {
  origin: '*',
  credentials: true,
};
global.codeMap = {};
global.limitTime = 60 * 1000; // 20s
const routes = require('./router/index');
app.use(cors(corsOptions));
app.use(express.json());
app.use(routes);

app.listen(port, () => {
  console.log(`Server is running on http://localhost:${port}`);
});
